<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,member-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<script type="text/javascript" src="lib/PIE_IE678.js"></script>
<![endif]-->
<link href="css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="css/H-ui.admin.css" rel="stylesheet" type="text/css" />
<link href="lib/Hui-iconfont/1.0.1/iconfont.css" rel="stylesheet"
	type="text/css" />
<link href="css/pagination.css" rel="stylesheet" type="text/css" />
<!--[if IE 6]>
<script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>T_shipping管理</title>
<style>
.title {
	display: block;
	background: #5a98de;
	line-height: 31px;
	float: left;
	color: white;
	width: 95px;
	text-align: center;
}

.title:hover {
	text-decoration: none;
	color: white;
}
</style>
</head>
<c:if test="${message==1}">
		<script  type="text/javascript">
			var msg = "已派送";
			window.location = "<%=path%>/backstage/t_shipping_listbyterm?status=2";
			alert(msg);
		</script>
</c:if>
<c:if test="${message==2}">
		<script  type="text/javascript">
			var msg = "已更改派送";
			window.location = "<%=path%>/backstage/t_shipping_listbyterm?status=2";
			alert(msg);
		</script>
</c:if>
<body>
	<nav class="breadcrumb">
		<a class="btn btn-success btn-refresh radius r mr-20"
			style="line-height:1.6em;margin-top:3px" onclick="javascript:location.replace(location.href);"
			href="javascript:location.replace(location.href);" title="刷新">刷新</a>
	</nav>
	
	<div class="pd-20">
		<div class="cl pd-5 bg-1 bk-gray"> 
			<a id="all" style="border-top-left-radius:5px;border-bottom-left-radius:5px;" class="title">全部</a>
			<a id="zero" style="" class="title">待派单</a>
			<a id="one" style="" class="title">待接单</a>
			<a id="two" style="" class="title">取货中</a>
			<a id="three" style="" class="title">配送中</a>
			<a id="four" style="" class="title">已完成</a>
		 	<a id="five" style="border-top-right-radius:5px;border-bottom-right-radius:5px;" class="title">已评价</a>
		 </div>
		
		<div class="cl pd-5 bg-1 bk-gray" style="margin-top:20px;"> 
		  <form action="<%=path%>/backstage/t_shipping_listbyterm" method="get"
				class="form form-horizontal" id="form-list_byterm">
				<div class="text-c">
				<div class="row cl">
					<label class="form-label col-1">订单号：</label>
					<div class="formControls col-2">
					<input type="hidden" value="${status}" name="status" id="status">
						<input type="text" value="${titles}" name="titles" id="titles" placeholder="订单号" class="input-text">
					</div>

					<label class="form-label col-1">收货电话：</label>
					<div class="formControls col-2">
						<input type="text" value="${mobile}" name="mobile" id="mobile" placeholder="收货电话" class="input-text">
					</div>
					<label class="form-label col-1">订单类型：</label>
					<div class="formControls col-2">
					<span class="select-box">
					<select name="ordertype" class="select">
						<option value="" selected>默认</option>
						<option value="0" <c:if test="${!empty ordertype && ordertype==0}">selected</c:if>>购物订单</option>
						<option value="2" <c:if test="${ordertype==2}">selected</c:if>>充值有礼</option>
						<option value="3" <c:if test="${ordertype==3}">selected</c:if>>积分兑换</option>
						<option value="4" <c:if test="${ordertype==4}">selected</c:if>>一元购</option>
					</select>
					</span>
					</div>
					
				</div>
				<div class="row cl">
					<label class="form-label col-1">配送员：</label>
					<div class="formControls col-2">
						<input type="text" value="${c_tname}" name="c_tname" id="c_tname" placeholder="配送员" class="input-text">
					</div>
					<label class="form-label col-1">收货人：</label>
					<div class="formControls col-2">
						<input type="text" value="${name}" name="name" id="name" placeholder="收货人" class="input-text">
					</div>
					<label class="form-label col-1">支付方式：</label>
					<div class="formControls col-2">
					<span class="select-box">
					<select name="zf_type" class="select">
						<option value="" selected>默认</option>
						<option value="0" <c:if test="${!empty zf_type && zf_type=='0'}">selected</c:if>>在线支付</option>
						<option value="3" <c:if test="${zf_type=='3'}">selected</c:if>>货到付款</option>
						<option value="4" <c:if test="${zf_type=='4'}">selected</c:if>>积分兑换</option>
					</select>
					</span>
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-1">配送日期：</label>
					<div class="formControls col-2">
					<input type="text" onfocus="WdatePicker({maxDate:'#F{$dp.$D(\'datemax2\')}'})" id="datemin2" value="${sendDate1}" name="sendDate1" class="input-text Wdate">
					</div>
					<div class="formControls col-2">
					<input type="text" onfocus="WdatePicker({minDate:'#F{$dp.$D(\'datemin2\')}'})" id="datemax2" value="${sendDate2}" name="sendDate2" class="input-text Wdate">
					</div>
					<label class="form-label col-1">下单日期：</label>
					<div class="formControls col-2">
					<input type="text" onfocus="WdatePicker({maxDate:'#F{$dp.$D(\'datemax1\')}'})" id="datemin1" value="${app_date1}" name="app_date1" class="input-text Wdate">
					</div>
					<div class="formControls col-2">
					<input type="text" onfocus="WdatePicker({minDate:'#F{$dp.$D(\'datemin1\')}'})" id="datemax1" value="${app_date2}" name="app_date2" class="input-text Wdate">
					</div>
				</div>	
					<div class="row cl">
					<button name="" id="" class="btn btn-success" style="border-radius:5px;float:right;" type="submit">
						 查询
					</button>
					<div style="width:10px;height:5px;float:right;"></div>
					<a class="btn btn-danger radius" onclick="type_reset('<%=path%>/backstage/t_shipping_list')" href="javascript:;" style="border-radius:5px;float:right;">
						<i class="Hui-iconfont"></i>重置
					</a>
					</div>
				</div>
			</form>
		 </div>

		<div class="mt-20">
			<table style="width:2000px;"
				class="table table-border table-bordered table-hover table-bg table-sort">
				<thead>
					<tr class="text-c">
						
                        <th width="100">编号</th>
                        <th width="100">订单号</th>
                        <th width="100">订单状态</th>
                        <th width="100">商家名称</th>
                        <th width="100">取货地址</th>
                        <th width="100">支付方式</th>
                        <th width="100">应收款金额</th>
                        <th width="100">订单金额</th>
                        <th width="100">收货地址</th>
                        <th width="100">收货人</th>
                        <th width="100">收货电话</th>
                        <th width="100">配送员</th>
                        <th width="100">操作</th>
                        <th width="100">备注信息</th>
                        <!-- <th width="100">订单类型</th>
						<th width="100">取货应支付金额</th> -->
                        <th width="100">下单时间</th>
                        <th width="100">取货时间</th>
                        <th width="100">配送评价</th>
						
					</tr>
				</thead>
				<tbody>
						<c:forEach items="${t_shippings}" var="t_shipping">
						
						<tr class="text-c">
							<input type="hidden" id="id" name="id"
								value='${t_shipping.shipping_id}' />
								
                            <td>${t_shipping.shipping_id}</td>
                            <td>${t_shipping.titles}</td>
                            <c:choose>
                                <c:when test="${t_shipping.enable == 2 || t_shipping.enable == 4}">
                                		<td>已取消</td>
                                </c:when>
                                <c:otherwise>
		                            <c:if test="${t_shipping.status==0}">
		                            	<td>待配送</td>
		                            </c:if>
		                            <c:if test="${t_shipping.status==1}">
		                            	<td>待接单</td>
		                            </c:if>
		                            <c:if test="${t_shipping.status==2||t_shipping.status==3}">
		                            	<td>取货中</td>
		                            </c:if>
		                            <c:if test="${t_shipping.status==4}">
		                            	<td>配送中</td>
		                            </c:if>
		                            <c:if test="${t_shipping.status==6}">
		                            	<td>已完成</td>
		                            </c:if>
                                </c:otherwise>
                            </c:choose>
                            
                            
                            <td>${t_shipping.c_sname}</td>
                            <td>${t_shipping.c_address}</td>
                            <c:if test="${t_shipping.zf_type=='0'||t_shipping.zf_type=='1'||t_shipping.zf_type=='2'}">
                            	<td>在线支付</td>
                            </c:if>
                            <c:if test="${t_shipping.zf_type=='3'}">
                            	<td>货到付款</td>
                            </c:if>
                            <c:if test="${t_shipping.zf_type=='4'}">
                            	<td>积分兑换</td>
                            </c:if>
                            <c:if test="${t_shipping.zf_type=='0,1'}">
                            	<td>余额支付+支付宝</td>
                            </c:if>
                            <c:if test="${t_shipping.zf_type=='0,2'}">
                            	<td>余额支付+微信</td>
                            </c:if>
                            
                            <c:choose>
                            		<c:when test="${t_shipping.zf_type=='3'}">
                            			<td>${t_shipping.payMoney}</td>
                          			</c:when>
                          			<c:otherwise>
                          				<td>0.0</td>
                          			</c:otherwise>
                            </c:choose>
                             <td>${t_shipping.money}</td>
                            <td>${t_shipping.address}</td>
                            <td>${t_shipping.name}</td>
                            <td>${t_shipping.mobile}</td>
                            <td>${ empty t_shipping.c_tname ? '---' : t_shipping.c_tname}</td>
                            <td class="td-manage">
								<a class="label label-primary radius"
								onClick="t_shipping_edit(this,'${t_shipping.rid}')" href="javascript:void(0);"
								title="详情">详情</a>
								<c:if test="${t_shipping.status==0}">
                            	<a class="label label-primary radius"
								onClick="t_shipping_allocate(this,'${t_shipping.shipping_id}','${t_shipping.titles}')" href="javascript:void(0);"
								title="立即派单">立即派单</a>
                            	</c:if>
                            	<c:if test="${t_shipping.status==1||t_shipping.status==2||t_shipping.status==3}">
                            	<a class="label label-primary radius"
								onClick="Shippers_change_pd(this,'${t_shipping.shipping_id}','${t_shipping.titles}')" href="javascript:void(0);"
								title="更改派单">更改派单</a>
                            	</c:if>
                            	<c:if test="${t_shipping.status==4}">
                            	<a class="label label-primary radius"
								onClick="Shippers_change_pd(this,'${t_shipping.shipping_id}','${t_shipping.titles}')" href="javascript:void(0);"
								title="更改派单">更改派单</a>
                            	</c:if>
							</td>
                            <td>${ empty t_shipping.bz ? '---' : t_shipping.bz}</td>
							
                           <%--  <c:if test="${t_shipping.ordertype==0}">
                            	<td>购物订单</td>
                            </c:if>
                            <c:if test="${t_shipping.ordertype==2}">
                            	<td>充值有礼</td>
                            </c:if>
                            <c:if test="${t_shipping.ordertype==3}">
                            	<td>积分兑换</td>
                            </c:if>
                            <c:if test="${t_shipping.ordertype==4}">
                            	<td>一元购</td>
                            </c:if> --%>
                           <%-- 	<c:if test="${t_shipping.zf_type==0||t_shipping.zf_type==1||t_shipping.zf_type==2}">
                            	<td>${t_shipping.getMoney}</td>
                            </c:if>
                            <c:if test="${t_shipping.zf_type==3}">
                            	<td>---</td>
                            </c:if>
                            <c:if test="${t_shipping.zf_type==4}">
                            	<td>---</td>
                            </c:if> --%>
                            
                            <td>${t_shipping.app_date}</td>
                            <td>${t_shipping.sendDate}</td>
                            <c:if test="${t_shipping.c_tname==null||t_shipping.c_tname==''}">
                            	<td>---</td>
                            </c:if>
                            <c:if test="${t_shipping.c_tname!=null&&t_shipping.c_tname!=''}">
                            	<c:if test="${t_shipping.shipping_remark==0}">
                            	<td>未评价</td>
                            	</c:if>
                            	<c:if test="${t_shipping.shipping_remark!=0}">
                            	<td>${t_shipping.shipping_remark}</td>
                            	</c:if>
                            </c:if>
                            
							
						</tr>
					</c:forEach>
				</tbody>
			</table>
			<div id="Pagination" class="page-con"></div>
		</div>
	</div>
	<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script>
	<script type="text/javascript" src="lib/layer/1.9.3/layer.js"></script>
	<script type="text/javascript" src="lib/laypage/1.2/laypage.js"></script>
	<script type="text/javascript" src="lib/My97DatePicker/WdatePicker.js"></script>
	<script type="text/javascript"
		src="lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
	<script type="text/javascript" src="js/H-ui.js"></script>
	<script type="text/javascript" src="js/H-ui.admin.js"></script>
	<script type="text/javascript" src="js/jquery.pagination.js"></script>
	<script type="text/javascript">
	$(function() {
		initPager();
	});
	
	var showCount = ${pageInfo.showCount};
	var currentPage = ${pageInfo.currentPage-1};
	var totalResult = ${pageInfo.totalResult};
	function initPager(){
		$("#Pagination").pagination(totalResult, {
            callback: function(new_page_index, pagination_container){
            	var oldLocation = location.href;
            	var pa = "currentPage=" + (new_page_index+1);
        		var shoC = "showCount=" + showCount;
            	var index = oldLocation.lastIndexOf("?");
            	if (index == -1){
            		location.href = oldLocation + "?" + pa + "&" + shoC;
            	}else if (oldLocation.indexOf("currentPage") == -1){
            		location.href = oldLocation + "&" + pa;
            	}else if (oldLocation.indexOf("showCount") == -1){
            		location.href = oldLocation + "&" + shoC;
            	}else{
            		var temp = oldLocation.replace(/currentPage=\d+/, pa);
					var newLocation = temp.replace(/showCount=\d+/, shoC);
            		location.href = newLocation;
            	}
            	return false;
            },
            items_per_page:showCount, 
            load_first_page:false,
            prev_text:'上一页',
            next_text:'下一页',
            ellipse_text:'...',
            num_edge_entries:1,
            num_display_entries:5,
            current_page:currentPage,
        });
	}
		
		/*重置*/
		function type_reset(url){
			window.location = url;
		}
		
		/*详情*/
		function t_shipping_edit(obj,id,w,h){
			var edit_page = "<%=path%>/backstage/order-details?rid="+id;
			layer_show("详情",edit_page,w,h);
		}

		/*立即派单*/
		function t_shipping_allocate(obj,id,title,w,h){
			var edit_page = "<%=path%>/backstage/Shippers_pd?shipping_id="+id+"&titles="+title+"&thetype=1";
			layer_show("立即派单",edit_page,w,h);
		}
		
		/*更改派单*/
		function Shippers_change_pd(obj,id,title,w,h){
			var edit_page = "<%=path%>/backstage/Shippers_change_pd?shipping_id="+id+"&titles="+title+"&thetype=1";
			layer_show("更改派单",edit_page,w,h);
		}
		
		
		
		if($("#status").val()==1){
			$("#all").css({"background":"white","border":"1px solid black","color":"black"});
			$("#zero").css({"background":"white","border":"1px solid black","color":"black"});
			$("#one").css({"background":"#5a98de","border":"1px solid #5a98de"});
			$("#two").css({"background":"white","border":"1px solid black","color":"black"});
			$("#three").css({"background":"white","border":"1px solid black","color":"black"});
			$("#four").css({"background":"white","border":"1px solid black","color":"black"});
			$("#five").css({"background":"white","border":"1px solid black","color":"black"});
		}else if($("#status").val()==0){
			$("#all").css({"background":"white","border":"1px solid black","color":"black"});
			$("#zero").css({"background":"#5a98de","border":"1px solid #5a98de"});
			$("#one").css({"background":"white","border":"1px solid black","color":"black"});
			$("#two").css({"background":"white","border":"1px solid black","color":"black"});
			$("#three").css({"background":"white","border":"1px solid black","color":"black"});
			$("#four").css({"background":"white","border":"1px solid black","color":"black"});
			$("#five").css({"background":"white","border":"1px solid black","color":"black"});
		}else if($("#status").val()==2){
			$("#all").css({"background":"white","border":"1px solid black","color":"black"});
			$("#zero").css({"background":"white","border":"1px solid black","color":"black"});
			$("#one").css({"background":"white","border":"1px solid black","color":"black"});
			$("#two").css({"background":"#5a98de","border":"1px solid #5a98de"});
			$("#three").css({"background":"white","border":"1px solid black","color":"black"});
			$("#four").css({"background":"white","border":"1px solid black","color":"black"});
			$("#five").css({"background":"white","border":"1px solid black","color":"black"});
		}else if($("#status").val()==4){
			$("#all").css({"background":"white","border":"1px solid black","color":"black"});
			$("#zero").css({"background":"white","border":"1px solid black","color":"black"});
			$("#one").css({"background":"white","border":"1px solid black","color":"black"});
			$("#two").css({"background":"white","border":"1px solid black","color":"black"});
			$("#three").css({"background":"#5a98de","border":"1px solid #5a98de"});
			$("#four").css({"background":"white","border":"1px solid black","color":"black"});
			$("#five").css({"background":"white","border":"1px solid black","color":"black"});
		}else if($("#status").val()==6){
			$("#all").css({"background":"white","border":"1px solid black","color":"black"});
			$("#zero").css({"background":"white","border":"1px solid black","color":"black"});
			$("#one").css({"background":"white","border":"1px solid black","color":"black"});
			$("#two").css({"background":"white","border":"1px solid black","color":"black"});
			$("#three").css({"background":"white","border":"1px solid black","color":"black"});
			$("#four").css({"background":"#5a98de","border":"1px solid #5a98de"});
			$("#five").css({"background":"white","border":"1px solid black","color":"black"});
		}else if($("#status").val()==5){
			$("#all").css({"background":"white","border":"1px solid black","color":"black"});
			$("#zero").css({"background":"white","border":"1px solid black","color":"black"});
			$("#one").css({"background":"white","border":"1px solid black","color":"black"});
			$("#two").css({"background":"white","border":"1px solid black","color":"black"});
			$("#three").css({"background":"white","border":"1px solid black","color":"black"});
			$("#four").css({"background":"white","border":"1px solid black","color":"black"});
			$("#five").css({"background":"#5a98de","border":"1px solid #5a98de"});
		}else{
			$("#all").css({"background":"#5a98de","border":"1px solid #5a98de"});
			$("#zero").css({"background":"white","border":"1px solid black","color":"black"});
			$("#one").css({"background":"white","border":"1px solid black","color":"black"});
			$("#two").css({"background":"white","border":"1px solid black","color":"black"});
			$("#three").css({"background":"white","border":"1px solid black","color":"black"});
			$("#four").css({"background":"white","border":"1px solid black","color":"black"});
			$("#five").css({"background":"white","border":"1px solid black","color":"black"});
		}
		
		//选择状态
		$("#all").click(function(){
			$("#status").val(-1);
			$("#form-list_byterm").submit();
			$("#all").css({"background":"#5a98de","border":"1px solid #5a98de"});
			$("#zero").css({"background":"white","border":"1px solid black","color":"black"});
			$("#one").css({"background":"white","border":"1px solid black","color":"black"});
			$("#two").css({"background":"white","border":"1px solid black","color":"black"});
			$("#three").css({"background":"white","border":"1px solid black","color":"black"});
			$("#four").css({"background":"white","border":"1px solid black","color":"black"});
			$("#five").css({"background":"white","border":"1px solid black","color":"black"});
		});
		
		//选择状态
		$("#zero").click(function(){
			$("#status").val(0);
			$("#form-list_byterm").submit();
			$("#all").css({"background":"white","border":"1px solid black","color":"black"});
			$("#zero").css({"background":"#5a98de","border":"1px solid #5a98de"});
			$("#one").css({"background":"white","border":"1px solid black","color":"black"});
			$("#two").css({"background":"white","border":"1px solid black","color":"black"});
			$("#three").css({"background":"white","border":"1px solid black","color":"black"});
			$("#four").css({"background":"white","border":"1px solid black","color":"black"});
			$("#five").css({"background":"white","border":"1px solid black","color":"black"});
		});
		
		//选择状态
		$("#one").click(function(){
			$("#status").val(1);
			$("#form-list_byterm").submit();
			$("#all").css({"background":"white","border":"1px solid black","color":"black"});
			$("#zero").css({"background":"white","border":"1px solid black","color":"black"});
			$("#one").css({"background":"#5a98de","border":"1px solid #5a98de"});
			$("#two").css({"background":"white","border":"1px solid black","color":"black"});
			$("#three").css({"background":"white","border":"1px solid black","color":"black"});
			$("#four").css({"background":"white","border":"1px solid black","color":"black"});
			$("#five").css({"background":"white","border":"1px solid black","color":"black"});
		});
		//选择状态
		$("#two").click(function(){
			$("#status").val(2);
			$("#form-list_byterm").submit();
			$("#all").css({"background":"white","border":"1px solid black","color":"black"});
			$("#zero").css({"background":"white","border":"1px solid black","color":"black"});
			$("#one").css({"background":"white","border":"1px solid black","color":"black"});
			$("#two").css({"background":"#5a98de","border":"1px solid #5a98de"});
			$("#three").css({"background":"white","border":"1px solid black","color":"black"});
			$("#four").css({"background":"white","border":"1px solid black","color":"black"});
			$("#five").css({"background":"white","border":"1px solid black","color":"black"});
		});
		//选择状态
		$("#three").click(function(){
			$("#status").val(4);
			$("#form-list_byterm").submit();
			$("#all").css({"background":"white","border":"1px solid black","color":"black"});
			$("#zero").css({"background":"white","border":"1px solid black","color":"black"});
			$("#one").css({"background":"white","border":"1px solid black","color":"black"});
			$("#two").css({"background":"white","border":"1px solid black","color":"black"});
			$("#three").css({"background":"#5a98de","border":"1px solid #5a98de"});
			$("#four").css({"background":"white","border":"1px solid black","color":"black"});
			$("#five").css({"background":"white","border":"1px solid black","color":"black"});
		});
		//选择状态
		$("#four").click(function(){
			$("#status").val(6);
			$("#form-list_byterm").submit();
			$("#all").css({"background":"white","border":"1px solid black","color":"black"});
			$("#zero").css({"background":"white","border":"1px solid black","color":"black"});
			$("#one").css({"background":"white","border":"1px solid black","color":"black"});
			$("#two").css({"background":"white","border":"1px solid black","color":"black"});
			$("#three").css({"background":"white","border":"1px solid black","color":"black"});
			$("#four").css({"background":"#5a98de","border":"1px solid #5a98de"});
			$("#five").css({"background":"white","border":"1px solid black","color":"black"});
		});
		//选择状态
		$("#five").click(function(){
			$("#status").val(5);
			$("#form-list_byterm").submit();
			$("#all").css({"background":"white","border":"1px solid black","color":"black"});
			$("#zero").css({"background":"white","border":"1px solid black","color":"black"});
			$("#one").css({"background":"white","border":"1px solid black","color":"black"});
			$("#two").css({"background":"white","border":"1px solid black","color":"black"});
			$("#three").css({"background":"white","border":"1px solid black","color":"black"});
			$("#four").css({"background":"white","border":"1px solid black","color":"black"});
			$("#five").css({"background":"#5a98de","border":"1px solid #5a98de"});
		});
	</script>
</body>
</html>



